package com.huiren.ui.importUI;

import java.util.ArrayList;
import java.util.List;

import javax.swing.table.AbstractTableModel;

import com.huiren.bean.Order;

public class DateTableModel extends AbstractTableModel {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String columns[] = { "单据号", "药库", "供应商", "创建时间", "条目数", "状态" };

	private List<Order> orderList = new ArrayList<Order>();

	public DateTableModel() {

	}

	public int getRowCount() {
		return orderList.size();
	}

	public int getColumnCount() {
		return columns.length;
	}

	public Object getValueAt(int r1, int r2) {
		Order order = orderList.get(r1);

		switch (r2)

		{

		case 0:
			return order.getPlan_code();
		case 1:
			return order.getWarehouse_id();
		case 2:
			return order.getOrg_abbr_name();
		case 3:
			return order.getCreate_date();
		case 4:
			return order.getPurordercount();
		case 5:
			return order.getIsok()==0?"未导入":"已导入";
		default:
			return "";

		}

	}

	public String getColumnName(int c) {
		return columns[c];
	}

	public List<Order> getOrderList() {
		return orderList;
	}

	public void setOrderList(List<Order> orderList) {
		this.orderList = orderList;
	}

}